import React, {Component} from 'react';
import {Link} from 'react-router-dom'
import {CityPicker} from 'react-weui'
import cnCity from './cnCity'
import 'weui'
import './index.css'

class Index extends Component {
    constructor(props) {
        super(props)
        this.state = {
            city_show: false,
            city_value: ''
        };
    }

    render() {
        return (
            <div className='mormal-font index'>
                <div  onClick={ e=> {
                    e.preventDefault();
                    this.setState({city_show: true})
                }} className='city'>
                <div>北京市</div>
                <div>北京市</div>
                <div>北京市</div>
                </div>
                <Link to='/wx/order'><div className='index-button'><button>我要用车</button></div></Link>
                <CityPicker
                    data={cnCity}
                    onCancel={e=>this.setState({city_show: false})}
                    onChange={text=>this.setState({city_value: text, city_show: false})}
                    show={this.state.city_show}
                />
            </div>
        )
    }

}
export default Index